<cfparam name = "errormsg" default="">
<cfparam name = "admin_username" default="">
<cfinvoke component="cfcs.common.captcha" method="createit" returnvariable="CaptchaString" />
<cfset strCaptcha = CaptchaString[1]>
<cfset captcha_check = CaptchaString[2]>
<cfoutput>
<form target="_top" method="POST" action="index.cfm" name="loginform" id="loginform">
<div id="login_div">
	<div id="login_box">
        <div id="login_title">#request.lang.login_title#</div>
        <div id="login_formfields">
        	<div id="login_labels">#request.lang.login_username#</div>
            <div id="login_fields"><input name="admin_username" type="text" id="admin_username" size="20" value="#admin_username#"></div>
            <div class="clear"></div>
        </div>
        <div id="login_formfields">
        	<div id="login_labels">#request.lang.login_password#</div>
            <div id="login_fields"><input name="admin_password" type="Password" size="20"></div>
			<div class="clear"></div>
        </div>
        <div id="captchatxt">#request.lang.login_captchatxt#</div>
        <div id="captchabox">
			<div id="captchaimg">
           	<cfimage action="captcha" width="106" height="38" text="#strCaptcha#" fontsize="26" difficulty="low" fonts="Serif.plain" color="captcha_image"><input type="hidden" name="captcha_check" value="#captcha_check#">
            </div>
            <div id="captchainput"><input name="vcode" type="text" value="" size="8" />&nbsp;(#request.lang.login_casewarning#)</div>
       		<div class="clear"></div>
        </div>
		<div id="login_button">
            <input name="EnterButton" type="submit" id="abutton" value="Login">
        </div>
     	<div id="login_failure">
          <cfif len(trim(errormsg)) GT 0>#errormsg#</cfif>
        </div>
    </div>
</div>
</form>
</cfoutput>
<cfif len(trim(admin_username)) IS 0>
	<script language="javascript">
		document.loginform.admin_username.focus();	
	</script>
<cfelse>
	<script language="javascript">
		document.loginform.admin_password.focus();	
	</script>
</cfif>